from django.shortcuts import render
from django.http import HttpResponse


# Create your views here.

def book(request):
    return HttpResponse('图书首页')


'''
http://127.0.0.1:8000/book/detail/1/1
'''
def book_detail(request, category_id, book_id):
    text = '当前图书分类：%s，当前图书ID：%s' % (category_id, book_id)
    return HttpResponse(text)


'''
http://127.0.0.1:8000/author/?id=1
'''
def book_author(request):
    author_id = request.GET.get('id', default='')
    text = '当前图书作者：%s' % author_id,
    return HttpResponse(text)
